package com.easycoding.framework.util;

import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;

/**
 * <b>Description</b>:java对象的字符串输出,含具体的数据<br/>
 * <b>Create Date</b>: 2013-3-8 下午5:13:39<br/>
 * <b>Version</b>: Since JDK 1.6.0<br/>
 * <b>Package</b>: com.easycoding.easyweb.framework.util
 */
public class ToStringUtil {

	/**
	 * 默认输出成:Person@182f0db[name=John Doe,age=33,smoker=false]
	 * @param object
	 * @return
	 */
	public static String toString(Object object){
		return ToStringUtil.toString(object,null);
	}
	
	/**
	 * 输出格式自选
	 * @param object
	 * @param style
	 * @return
	 */
	public static String toString(Object object,ToStringStyle style){
		return new ToStringBuilder(object,style).toString();
	}
}
